package com.zzh.pojo.vo;

import lombok.Data;
import org.springframework.ai.chat.messages.Message;
import org.springframework.ai.chat.messages.MessageType;

@Data
public class MessageVO {
    private String role;
    private String content;

    public MessageVO(Message message) {
    this.content = message.getText();
        MessageType messageType = message.getMessageType();
//        switch (messageType) {
//            case USER:
//                this.role = "user";
//                break;
//            case ASSISTANT:
//                this.role = "assistant";
//                break;
//            case SYSTEM:
//                this.role = "system";
//                break;
//            default:
//                this.role = "unknown";
//                break;
//        }
        this.role = messageType.getValue();

    }


}
